# 以下为连接配置，请勿随意更改
import sys

master_host = '10.10.69.30'
redis_host = '10.10.69.30'
redis_port = 6379

error_task_queue = 'error_task'
error_task_loop_count = 10
response_queue = 'response'

worker_lowest_memory_MB = 500
chromedriver_url = 'https://chromedriver.chromium.org/downloads'
chromedriver_path = sys.path[0] + '/tools'
zip_file_name = 'chromedriver_win32.zip'
max_webdriver = 10


class TwitterConfig:
    def __init__(self):
        self.max_thread = 30
        self.redis_host = redis_host
        self.redis_port = redis_port
        self.urgent_task_queue = 'urgent_task_twitter'
        self.task_queue = 'task_twitter'
        self.worker_file = './worker_file/twitter_worker.py'
        self.response_queue = response_queue
        self.error_task_queue = error_task_queue
        self.task_type_search = 'SEARCH'
        self.task_type_timeline = 'TIMELINE'
        self.guest_token_url = 'https://api.twitter.com/1.1/guest/activate.json'
        self.chromedriver_path = chromedriver_path
        self.chromedriver_url = chromedriver_url
        self.zip_file_name = zip_file_name
        self.header = {'authority': 'twitter.com',
                       'method': 'GET',
                       'path': '',
                       'scheme': 'https',
                       'accept': '*/*',
                       'accept-encoding': 'gzip, deflate, br',
                       'accept-language': 'zh-CN,zh;q=0.9',
                       'authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
                       'cookie': 'personalization_id="v1_1By4WUgabU+79Sr4bKsP5w=="; guest_id=v1:162154103032126079; _ga=GA1.2.1080343483.1621604100; eu_cn=1; G_ENABLED_IDPS=google; _gid=GA1.2.987455938.1630073075; external_referer=padhuUp37zjgzgv1mFWxJ5Xq0CLV+bpWuS41v6lN3QU=|0|8e8t2xd8A2w=; '
                                 'ct0=274b24020c92ca3d44b24db9770fbbd9; gt=1433881876201152516',
                       'referer': '',
                       'sec-ch-ua': '"Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"',
                       'sec-ch-ua-mobile': '?0',
                       'sec-fetch-dest': 'empty',
                       'sec-fetch-mode': 'cors',
                       'sec-fetch-site': 'same-origin',
                       'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36',
                       'x-csrf-token': '',
                       'x-guest-token': '',
                       'x-worker_file-active-user': 'yes',
                       'x-worker_file-client-language': 'zh-cn',
                       }


class YoutubeConfig:
    def __init__(self):
        self.max_thread = 0
        self.redis_host = redis_host
        self.redis_port = redis_port
        self.urgent_task_queue = 'urgent_task_youtube'
        self.task_queue = 'task_youtube'
        self.worker_file = './worker_file/test_worker2.py'
        self.response_queue = response_queue
        self.error_task_queue = error_task_queue


